package cn.itcast.job;

import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.extern.slf4j.Slf4j;

import java.util.Date;

/**
 * @program: schedule
 * @description: 简单的定时任务
 * @author: zhanghz001
 * @create: 2021-08-04 14:20
 **/
@Slf4j
public class ZhzSimpleJob implements SimpleJob {
    @Override
    public void execute(ShardingContext shardingContext) {
        int totalCount = shardingContext.getShardingTotalCount();
        int item = shardingContext.getShardingItem();
        log.info("ZhzSimpleJob 作业执行时间: {}, 分片总数: {} , 当前分片: {}", new Date(), totalCount, item);
    }
}
